<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/templates/default.xhtml">
	<ui:define name="content">
		<h1>User List</h1>
		<h:form id="class">
			<div class="box-body">
				<div class="form-group">
					<h:dataTable value="#{usersController.users}" var="_user"
						styleClass="table table-bordered">
						<h:column>
							<f:facet name="header">Id</f:facet>
							<div class="center">#{_user.id}</div>
						</h:column>
						<h:column>
							<f:facet name="header">Username</f:facet>
							<h:commandLink value="#{_user.username}"
								action="#{usersController.edit}">
								<f:param name="selectedId" value="#{_user.id}" />
							</h:commandLink>
						</h:column>
						<h:column>
							<f:facet name="header">Email</f:facet>
							#{_user.email}
						</h:column>
						<h:column>
							<f:facet name="header">Delete</f:facet>
							<div class="center">
								<h:commandLink action="#{usersController.doDelete}">
									<i class="glyphicon glyphicon-remove"></i>
	                        		<f:param name="selectedId" value="#{_user.id}"/>
	                        	</h:commandLink>
                        	</div>
						</h:column>
					</h:dataTable>
				</div>
			</div>
			<div class="box-footer">
				<h:commandButton action="#{usersController.create}" value="New User" styleClass="btn btn-primary"/>
			</div>
		</h:form>
	</ui:define>
</ui:composition>